package cn.wolfcode.cms.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
@ToString
@JsonIgnoreProperties("handler")
public class OrderBill {
    public static final Integer NO_AUDIT = 0; // 表示未审核
    public static final Integer AUDIT = 1; // 表示已经审核

    private Long id;                  // 采购单 id

    private String sn;                // 编码
    @DateTimeFormat(pattern ="yyyy-MM-dd" )
    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
    private Date vdate;               // 业务时间

    private Integer status=NO_AUDIT;  // 状态 默认未审核

    private BigDecimal totalAmount;   // 订单总金额

    private BigDecimal totalNumber;   // 订单总数量
    @DateTimeFormat(pattern ="yyyy-MM-dd" )
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date auditTime;           // 审核时间
    @DateTimeFormat(pattern ="yyyy-MM-dd" )
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date inputTime;           // 录入时间

    private Employee inputUser;        // 录入人

    private Employee auditor;          // 审核人

    private Supplier supplier;         // 供应商

    private Depot depot;               // 仓库

    List<OrderBillItem> items=new ArrayList<>(); // 明细表集合

}